/**
 * @type {String}
 *
 * @properties={typeid:35,uuid:"B57F7175-2A41-4E63-966C-0FD507AA95C3"}
 */
var busqueda_cliente = '';

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"A0340F12-58FF-4CFF-8553-994D0177D966"}
 */
function btn_alta_cliente(event) {
		
		var win = application.createWindow(application.getUUID().toString(),JSWindow.MODAL_DIALOG);
		win.resizable = false;
		win.storeBounds = false;
		win.undecorated = false;
		
		forms.CLIENTE_EDIT.controller.newRecord();
		forms.CLIENTE_EDIT.elements.bnt_aceptar.visible= true;
		forms.CLIENTE_EDIT.elements.btn_cancelar.visible = true;
		forms.CLIENTE_EDIT.elements.btn_baja.visible = false;
		forms.CLIENTE_EDIT.elements.btn_volver.visible = false;
		forms.CLIENTE_EDIT.elements.label_sin_fondo.visible = false;
		forms.CLIENTE_EDIT.elements.label_fondo.visible = true;
		win.show(forms.CLIENTE_EDIT);
		
		
	}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 *
 * @properties={typeid:24,uuid:"5EB03697-32F6-417D-ADA5-58355EB0ED03"}
 */
function btn_ver_ficha(event) {
	
	forms.Inicio.elements.tab_mostrar.removeAllTabs();
	forms.Inicio.elements.tab_mostrar.addTab(forms.CLIENTE_FICHA);
	forms.CLIENTE_EDIT.foundset.loadRecords(forms.CLIENTES_lst.foundset.getSelectedRecord().clientes_id);
	forms.CLIENTE_EDIT.elements.bnt_aceptar.visible = false;
	forms.CLIENTE_EDIT.elements.btn_cancelar.visible = false;
	forms.CLIENTE_EDIT.elements.btn_volver.visible = true;
	forms.CLIENTE_EDIT.elements.btn_baja.visible = true;
	forms.CLIENTE_EDIT.elements.label_sin_fondo.visible = true;
	forms.CLIENTE_EDIT.elements.label_fondo.visible = false;

}

/**
 * @AllowToRunInFind
 * 
 * @param {Object} oldValue
 * @param {Object} newValue
 * @param {Object} event
 *
 * @properties={typeid:24,uuid:"5BE4F086-A045-4AA0-B677-920546CC8350"}
 */
function onDataChange(oldValue, newValue, event) {

			if (forms.CLIENTES_lst.foundset.find()){
				
				forms.CLIENTES_lst.nombre = "#%" + busqueda_cliente + "%";
				forms.CLIENTES_lst.foundset.search();
				
				
				return true;
			}else
				return false;
				
				
		}
